#include <bits/stdc++.h>
#include <utility>
using namespace std;

class Solution {
public:
    void rotate(vector<vector<int>>& matrix) {
        int row = matrix.size();
        int col = matrix[0].size();
        for(int i=0; i<(row>>1); ++i){
            swap(matrix[i], matrix[row-i-1]);
        }
        for(int i=0; i<row; ++i){
            for(int j=i+1; j<col; ++j){
                swap(matrix[i][j], matrix[j][i]);
            }
        }
    }
};

int main(){
    Solution solution;
    vector<vector<int>> matrix = {{1,2,3},{4,5,6},{7,8,9}};
    solution.rotate(matrix);
}